********************************************************************************
*Project:  	Swiss Trade During the Covid-19 Pandemic: An Early Appraisal	
*Authors:	KB, SL, VP, PW						
*This File: Master dofile
*Version: 	vFinal						
*Date: 		2020-09-01						
********************************************************************************

********************************************************************************
********************************************************************************
********************************************************************************
*SETTINGS
********************************************************************************
********************************************************************************
********************************************************************************

clear all
set more off, permanently
version 13

set seed 25021986

*set maxvar      30000, permanently
set max_memory  13g, permanently

*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
*ROOT
global root "2020_SJES_BUECHEL_ETAL"			
cd "$root"
*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

capture mkdir temp
capture mkdir figures
capture mkdir tables
capture mkdir workfiles

*ADDITIONAL PACKAGES
*reclink2

********************************************************************************
********************************************************************************
********************************************************************************
*EXECUTE
********************************************************************************
********************************************************************************
********************************************************************************

// DATA PREPARATION
do "${root}\do\01_clean_fca_classifications.do"
do "${root}\do\02a_clean_unctad_classifications.do"
do "${root}\do\02b_modify_unctad_classifications.do"
do "${root}\do\03a_clean_monthly_trade_data.do"

/*******************************************************************************
***WEEKLY DATA

The Federal Customs Administration does not publish weekly data on foreign trade 
and has only made them available to us after a request for narrow research purposes.
The data can be obtained under specific legal terms. For further information 
or to request the data please contact stat@ezv.admin.ch.

do "${root}\do\03b_clean_weekly_trade_data.do"

//VALIDATION OF WEEKLY DATA
do "${root}\do\04_validate_trade_data.do"
*******************************************************************************/

//FIGURES
do "${root}\do\FIG1_COVID.do"
*do "${root}\do\FIG2_Trade_weekly.do"
do "${root}\do\FIG3_2020Q1Q2_Trade_Products_Partners.do"
do "${root}\do\FIG4_Trade_2005_2020_sa.do"
do "${root}\do\FIG5_Trade_Compare_Covid19_Lehman.do"
do "${root}\do\FIG6_PMI_KS.do"
do "${root}\do\FIG7a_Protectionsim.do"
do "${root}\do\FIG7b_Exchange_Rates.do"

//TABLES
do "${root}\do\TAB2-3_regressions_panel_monthly.do"
do "${root}\do\TAB2-3_regressions_panel_Q1_Q2.do"
